﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TrainSimulator.Interfaces;
using TrainSimulator.Model;

namespace TrainSimulator.State
{
    public static class StateFactory
    {
        #region Train States
        private static IState _trainStarted;
        private static IState _trainStopped;
        private static IState _trainAccelerating;
        private static IState _trainBreaking;

        public static IState TrainStarted
        {
            get
            {
                if (_trainStarted == null)
                    _trainStarted = new TrainStarted();
                return _trainStarted;
            }
        }
        public static IState TrainStopped
        {
            get
            {
                if (_trainStopped == null)
                    _trainStopped = new TrainStopped();
                return _trainStopped;
            }
        }
        public static IState TrainAccelerating
        {
            get
            {
                if (_trainAccelerating == null)
                    _trainAccelerating = new TrainAccelerating();
                return _trainAccelerating;
            }
        }
        public static IState TrainBreaking
        {
            get
            {
                if (_trainBreaking == null)
                    _trainBreaking = new TrainBreaking();
                return _trainBreaking;
            }
        }
        #endregion
    }
}
